<template>
  <div>
    <van-nav-bar
      title="收藏列表"
      left-text="返回"
      fixed
      left-arrow
      @click-left="$router.back()"
    />
    <div class="pennel_header">
      <PublicCard v-for="item in list" :key="item.id" :item="item"></PublicCard>
    </div>
  </div>
</template>

<script>
import { getFavorite } from '@/api/user'
import PublicCard from '@/components/PublicCard'
export default {
  name: 'MyFavorite',
  data () {
    return {
      list: []
    }
  },
  components: { PublicCard },
  async created () {
    // 收藏信息
    const { body } = await getFavorite()
    this.list.push(...body)
  }
}
</script>

<style lang="less" scoped>
  .pennel_header {
    margin-top: 46px;
  }
</style>
